#!/bin/bash
source $OPENSHIFT_CARTRIDGE_SDK_BASH

export JAVA_HOME=/etc/alternatives/java_sdk_1.8.0
export PATH=$JAVA_HOME/bin:$PATH

# The logic to stop your application should be put in this script.
if [ -z "$(ps -ef | grep java.*\.jar | grep -v grep)" ]
then
    client_result "Application is already stopped"
else
    kill `ps -ef | grep java.*\.jar | grep -v grep | awk '{ print $2 }'` > /dev/null 2>&1
fi



